<template>
    <div style="height:100%;width:100%;" class="detail">
        <bar class="bar" @on-back="$router.back()" title="公告通知"></bar>
        <scroll :pageSize="pageSize" style="height: calc(100% - 45px);"
                :total="total"
                @on-infinite="getData">
            <div
                class="youba-list vux-tap-active"
                @click="$router.push('/noticeInfo?id=' + item.id)" v-for="(item, index) in list">
                <div>{{item.title}}</div>
                <div>{{item.createTime}}</div>
            </div>
        </scroll>
    </div>
</template>

<script>
    import scroll from '../../../components/scroll.vue'
    import {
        Bar
    } from 'muka-ui'
    import {
        Panel
    } from 'vux'

    export default {
        name: 'dataInfo',
        components: {
            Bar,
            Panel,
            scroll
        },
        data: function () {
            return {
                pageSize: 20,
                total: 0,
                num: 1,
                type: '1',
                list: [],
            }
        },
        created: function () {
            this.getData(1)
        },
        methods: {
            getData: function (pageNum, done) {
                this.$ajax(
                    'announcement/announceList',
                    {
                        pageNum: pageNum,
                        pageSize: this.pageSize
                    },
                    (content) => {
                        this.total = content.totalCount
                        this.list = this.list.concat(content.resultList)
                        if (done) {
                            done()
                        }
                    })
            }
        }
    }

</script>

<style lang="less">


</style>
